home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-06-24 | 37.3 KB | 1,101 lines |
- <html>
-
- <head>
- <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
- <title>'Admin' Data Import</title>
- <link rel="stylesheet" type="text/css" href="css/rpmstyle.css">
-
- <style>
-
- .StatMsg { height:280; width:400; font-family:arial; font-size: 8pt; font-weight: 700; color: windowtext; background-color: threedlightshadow; }
- .StatMsg { overflow : scroll}
-
- </style>
-
- <script>
- <!--
- var StatusMessageText = "";
-
- var UserIndex = 0;
- var UserName = "";
- var UserRecLength = 6; // User Lookup record length
- var UserCount = 0;
-
- var ServerIndex = 0;
- var ServerName = "";
- var ServerRecLength = 5; // Server record Length
- var ServerCount = 0;
-
- var GroupIndex = 0;
- var GroupName = "";
- var GroupRecLength = 4; // Length of a Group Lookup record in the Store
- var GroupLookupFlag = false;
- var GroupCount = 0;
-
- var ComputerIndex = 0;
- var ComputerName = "";
- var ComputerRecLength = 9; // Computer Lookup record length
- var ComputerCount = 0;
- var ComputerLookupFlag = false;
- var CArray = new Array();
-
- var ServiceIndex = 0;
- var ServiceName = "";
- var ServiceCount = 0;
- var ServiceType = "";
- var ServiceFreq = "";
- var ServiceAGID = "";
- var ServiceCID = "";
- var ServiceEnabled = "0";
- var ServiceOp = "";
- var ServiceLUPRecLength = 4;
-
- var ELIndex = 0;
- var ELName = "";
- var ELCount = 0;
- var ELOp = false;
-
- var WatchIndex = 0;
- var WatchName = "";
- var WatchRecLength = 23; // Watch/Alert Lookup record length
- var WatchCount = 0;
- var WatchLookup = false;
- var AGNArray = new Array();
- var ServicesType = "0", CounterType = "1", EventLogType ="2", UserType = "3";
- var CurrentAT = "0";
- var AGFinalIdx = 0;
- var AGFinal = false;
-
- var ReportIndex = 0;
- var ReportName = "";
- var ReportRecLength = 7; // Report Lookup record length
- var ReportCount = 0;
-
- var SNMPTrapIndex = 0;
- var SNMPTrapName = "";
- var SNMPTrapCount = 0;
-
- var SNMPTMarr = new Array();
- var SNMPTrapLupRecCount = 0;
-
- var OIDIndex = 0;
- var OIDName = "";
- var OIDCount = 0;
- var OIDArray = new Array();
- var OIDRecLength = 4;
-
- var NumberOfSelects = 0; // Used to determine the level of the Export
- var SNMPTrapLevel = 9; // Number of selects which implies SNMP Traps were Exported
-
- var borderSz = 2; // Thin Bord is 2pixels
- var Srd = null; // Server root directory
- var Tid = null;
-
-
- // Capture and ignore script errors
- window.onerror = wwScrErr;
- function wwScrErr() {
- return true;
- }
-
- /* On Load tell the Comm control to Connect to the Server */
- function processOnLoad() {
- Hp = parseInt(document.body.RPMHostPort,10);
- RpmCC_AC.Connect(document.body.RPMHostIP,Hp, "");
- }
- function processUnload() {
- RpmCC_AC.Disconnect();
- top.banner.processStopCommX();
- if ( Tid != null ) {
- clearTimeout(Tid); // stop timeout routine
- }
- }
-
- function processStartButton() {
- SetButtonState(CStartButton,"1");
- SetCursor("wait");
- top.banner.processStartComm();
- RpmCC_AC.GetServerRootDir(); // get server root directory; wait for response
- }
- function processDBUpdateContinue() {
- var wH = RpmCC_AC.OpenLocalFile(Srd+"\\AdminData.sav");
- if ( wH == 0 ) {
- alert("Error opening file '"+Srd+"\\AdminData.sav' to retrieve 'Admin' Data");
- updateStatusMessage("<br>-Error opening file '"+Srd+"\\AdminData.sav' to retrieve 'Admin' Data");
- processResetButton(); // reset
- return;
- }
- else {
- var aD = RpmCC_AC.ReadLn(wH); // read data
- if ( aD.length < 2 ) {
- alert("Error opening/reading file '"+Srd+"\\AdminData.sav' to retrieve 'Admin' Data.");
- updateStatusMessage("<br>-Error opening/reading file '"+Srd+"\\AdminData.sav' to retrieve 'Admin' Data.");
- processResetButton(); // reset
- return;
- }
- AdminDataStore.innerHTML = aD; // save data
- RpmCC_AC.CloseLocalFile(wH); // close file
- NumberOfSelects = document.all.tags("select").length;
- updateStatusMessage("<br>{Importing MonitorIT SERVER Records}<br>");
- Tid = setTimeout("processServerRecordAdd()",10); // get Server records
- }
- }
- function processServerRecordAdd() {
- Tid = null;
- if ( ServerIndex < AC_SrvStore.length ) {
- // Start Write of MonitorIT Server Records
- ServerName = AC_SrvStore[ServerIndex+0].text;
- rstat = RpmCC_AC.ServersAdd(ServerName,
- AC_SrvStore[ServerIndex+2].text,AC_SrvStore[ServerIndex+3].text,
- AC_SrvStore[ServerIndex+4].text);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- ServerIndex += ServerRecLength;
- return;
- }
- }
- updateStatusMessage("-Total of "+(ServerIndex/ServerRecLength)+" SERVER Record(s) Processed<br>");
- updateStatusMessage("-Total of "+ServerCount+" SERVER Record(s) Added<br>");
- updateStatusMessage("<br>{Importing GROUP Records}<br>");
- Tid = setTimeout("processGroupRecordAdd()",10); // get Group records
- }
- function processGroupRecordAdd() {
- Tid = null;
- if ( GroupIndex < AC_GrpStore.length ) {
- // Start Write of Group Records
- GroupName = AC_GrpStore[GroupIndex+0].text;
- rstat = RpmCC_AC.GroupAdd(GroupName,AC_GrpStore[GroupIndex+2].text);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- GroupIndex += GroupRecLength;
- return;
- }
- }
- // Done Importing Groups
- updateStatusMessage("-Total of "+(GroupIndex/GroupRecLength)+" GROUP Record(s) Processed<br>");
- updateStatusMessage("-Total of "+GroupCount+" GROUP Record(s) Added<br>");
- updateStatusMessage("<br>{Importing SERVER/COMPUTER Records}<br>");
- AC_GrpStore.innerHTML = ""; // clear Group Store
- GroupLookupFlag = true;
- if ( RpmCC_AC.GroupLookup("","","") ) { // Lookup Groups to get IDs
- updateStatusMessage("Unable to start the GROUP LOOKUP request<br>");
- processResetButton(); // reset
- }
- }
- /* Process Group LOOKUP RECORD Event */
- function processGroupLookupRecord(Gid,GrpName,GrpDesc) {
- GStoreObj = document.all.AC_GrpStore;
- addElementToSelect(GStoreObj,GrpName);
- addElementToSelect(GStoreObj,Gid);
- addElementToSelect(GStoreObj,GrpDesc);
- addElementToSelect(GStoreObj,0);
- }
- /* Process DB Error in Group Lookup Operation */
- function processGroupOpError() {
- updateStatusMessage("An error occurred during GROUP LOOKUP operation<br>");
- processResetButton(); // reset
- }
- /* Process Group OP Complete Event */
- function processGroupOpComplete() {
- Tid = setTimeout("processComputerRecordAdd()",10); // get Computer records
- }
- function processComputerRecordAdd() {
- Tid = null;
- if ( ComputerIndex < AC_Store.length ) {
- // Start Write of Server/Computer Records
- ComputerName = AC_Store[ComputerIndex+0].text;
- CGrpID = getGroupID( AC_Store[ComputerIndex+1].text );
- CDesc = AC_Store[ComputerIndex+2].text;
- CPswd = AC_Store[ComputerIndex+3].text;
- COSver = AC_Store[ComputerIndex+4].text;
- CIP = AC_Store[ComputerIndex+5].text;
- CPort = AC_Store[ComputerIndex+6].text;
- CSrvID = getServerID( AC_Store[ComputerIndex+7].text );
- CMonStart = ""; CMonStop = ""; CMonSched = 16843008;
- CDlvStart = ""; CDlvStop = ""; CDlvSched = 16843008;
- rstat = RpmCC_AC.ComputerAdd(ComputerName,CGrpID,CSrvID,CPswd,CDesc,CIP,CPort,COSver,
- CMonStart,CMonStop,CMonSched,CDlvStart,CDlvStop,CDlvSched);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- ComputerIndex += ComputerRecLength;
- return;
- }
- }
- updateStatusMessage("-Total of "+(ComputerIndex/ComputerRecLength)+" SERVER/COMPUTER Record(s) Processed<br>");
- updateStatusMessage("-Total of "+(ComputerCount/2)+" SERVER/COMPUTER Record(s) Added<br>");
- // Lookup computers to get all IDs if not all processed were added
- if ( ComputerIndex/ComputerRecLength != ComputerCount/2 ) {
- ComputerLookupFlag = true; // set flag
- ComputerCount = 0;
- CArray.length = 0;
- if ( RpmCC_AC.ComputerLookup("*","*") ) {
- updateStatMessage("-Unable to start the SERVER/COMPUTER LOOKUP request<br>");
- processResetButton(); // reset
- }
- }
- else {
- processComputerLookupDone();
- }
- }
- /* Process Computer Lookup Complete Event */
- function processComputerLookupDone() {
- updateStatusMessage("<br>{Importing WATCH/ALERT Records}<br>");
- Tid = setTimeout("processWatchRecordAdd()",10); // go next with Watch/Alert record
- }
- function processWatchRecordAdd() {
- Tid = null;
- if ( WatchIndex < AC_AlertStore.length ) {
- // Start Write of User Records
- WatchName = AC_AlertStore[WatchIndex+0].text;
- ADsc = AC_AlertStore[WatchIndex+2].text;
- AThr = AC_AlertStore[WatchIndex+3].text;
- AUnd = AC_AlertStore[WatchIndex+4].text;
- AEvt = AC_AlertStore[WatchIndex+5].text;
- ADur = AC_AlertStore[WatchIndex+6].text;
- ASch = AC_AlertStore[WatchIndex+7].text;
- ASdt = AC_AlertStore[WatchIndex+8].text;
- AEdt = AC_AlertStore[WatchIndex+9].text;
- AAid = AC_AlertStore[WatchIndex+10].text;
- ARit = AC_AlertStore[WatchIndex+11].text;
- AEp = AC_AlertStore[WatchIndex+12].text;
- AArg = AC_AlertStore[WatchIndex+13].text;
- AEno = AC_AlertStore[WatchIndex+14].text;
- AEad = AC_AlertStore[WatchIndex+15].text;
- AEs = AC_AlertStore[WatchIndex+16].text;
- APhn = AC_AlertStore[WatchIndex+17].text;
- APhnb = AC_AlertStore[WatchIndex+18].text;
- ATtk = AC_AlertStore[WatchIndex+19].text;
- APg = AC_AlertStore[WatchIndex+20].text;
- APgnb = AC_AlertStore[WatchIndex+21].text;
- ATtn = AC_AlertStore[WatchIndex+22].text;
- CurrentAT = getCurrentAT(ASdt);
- //if ( (CurrentAT = getCurrentAT(ASdt)) == CounterType ) {
- // AAid = processCounterAlert(AAid); // adjust Counter Alert
- //}
- lpreID = RpmCC_AC.AlertGroupPreliminaryAdd1(WatchName,ADsc,AThr,AUnd,
- AEvt,ADur,ASch,ASdt,AEdt,AAid);
- prelimID = ""+lpreID; // convert to string
- rstat = RpmCC_AC.AlertGroupPreliminaryAdd2(prelimID,ARit,AEp,AArg,AEno,
- AEad,AEs,APhn,APhnb,ATtk,APg,APgnb,ATtn);
- if ( rstat != (-1) ) {
- rstat = RpmCC_AC.AlertGroupCommitAdd(prelimID);
- }
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- WatchIndex += WatchRecLength;
- return;
- }
- }
- processWatchRecordDone();
- }
- function processWatchRecordDone() {
- updateStatusMessage("-Total of "+(WatchIndex/WatchRecLength)+" WATCH/ALERT Record(s) Processed<br>");
- updateStatusMessage("-Total of "+(WatchCount/3)+" WATCH/ALERT Record(s) Added<br>");
- if ( WatchIndex/WatchRecLength != WatchCount/3 ) {
- WatchLookup = true; // set flag
- WatchCount = 0;
- AGNArray.length = 0;
- if ( RpmCC_AC.AlertGroupLookup("*") ) {
- updateStatMessage("-Unable to start the WATCH/ALERT LOOKUP request<br>");
- processResetButton(); // reset
- }
- }
- else {
- processAlertGroupLookupDone();
- }
- }
- function processAlertGroupLookupDone() {
- updateStatusMessage("<br>{Importing SERVICES Records}<br>");
- if ( CArray.length > 0 ) {
- Tid = setTimeout("processServicesRecordAdd()",10); // get Services records
- }
- else {
- processServicesRecordDone();
- }
- }
- function processServicesRecordAdd() {
- Tid = null;
- ServiceOp = "Add";
- var warr = new Array;
- if ( ServiceIndex < AC_ServicesStore.length ) {
- var SAstrg = AC_ServicesStore[ServiceIndex].text;
- warr = SAstrg.split("~");
- ServiceName = warr[2];
- ComputerName = warr[0];
- warr[0] = getComputerID(warr[0]); // get Comp ID from name
- warr[1] = getAlertGroupID(warr[1]); // get AGID from name
- SAstrg = warr[0]+"~"+warr[1]+"~"+warr[2]+"~"+warr[3]+"~"+warr[4]+"~"+warr[5];
- SAstrg += "~"+warr[11]+"~"+warr[12]+"~"+warr[13]+"~"+warr[14];
- AC_ServicesStore[ServiceIndex].text = warr.join("~");
- rstat = RpmCC_AC.ServicesAdd(SAstrg);
- if ( !rstat ) { // if OK on initiate request
- ++ServiceIndex;
- ignoreDBChangeEvent = true;
- return;
- }
- }
- processServicesRecordDone();
- }
- function processServicesRecordDone() {
- ServiceOp = "";
- updateStatusMessage("-Total of "+ServiceIndex+" SERVICES Record(s) Processed<br>");
- updateStatusMessage("-Total of "+ServiceCount+" SERVICES Record(s) Added<br>");
- updateStatusMessage("<br>{Importing EVENT LOG WATCH Records}<br>");
- Tid = setTimeout("processELRecordAdd()",10); // get EL records
- }
- function processELRecordAdd() {
- Tid = null;
- ELOp= true;
- var warr = new Array;
- if ( ELIndex < AC_ELStore.length ) {
- var ELstrg = AC_ELStore[ELIndex].text;
- warr = ELstrg.split("~");
- ELName = warr[2]; // Alert Group Name
- ComputerName = warr[1];
- warr[1] = getComputerID(warr[1]); // get Comp ID from name
- warr[2] = getAlertGroupID(warr[2]); // get AGID from name
- ELstrg = warr[2]+"~"+warr[0]+"~"+warr[1];
- for ( var i=3; i<16; i++ ) {
- ELstrg += "~"+warr[i];
- }
- AC_ELStore[ELIndex].text = ELstrg;
- rstat = RpmCC_AC.ELMonitorAdd(ELstrg);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- ++ELIndex;
- return;
- }
- }
- processELRecordDone();
- }
- function processELRecordDone() {
- ELOp = false;
- updateStatusMessage("-Total of "+ELIndex+" EVENT LOG WATCH Record(s) Processed<br>");
- updateStatusMessage("-Total of "+ELCount+" EVENT LOG WATCH Record(s) Added<br>");
- if ( NumberOfSelects >= SNMPTrapLevel ) {
- updateStatusMessage("<br>{Importing SNMP OID Definition Records}<br>");
- OIDArray = AC_TrapMonitorStore.OIDDefs.split("~"); // parse
- Tid = setTimeout("processOIDDefsRecordAdd()",10); // get OID records
- }
- else {
- updateStatusMessage("<br>{Importing USER Records}<br>");
- Tid = setTimeout("processUserRecordAdd()",10); // get User records
- }
- }
- function processOIDDefsRecordAdd() {
- Tid = null;
- if ( OIDIndex < OIDArray.length-1 ) {
- var Ostrg = OIDArray[OIDIndex+1]+"~"+OIDArray[OIDIndex+2]+"~"+OIDArray[OIDIndex+3];
- OIDName = OIDArray[OIDIndex+1];
- rstat = RpmCC_AC.OidDefs("1","0",Ostrg);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- OIDIndex += OIDRecLength;
- return;
- }
- }
- processOIDDefsDone();
- }
-
- function processOIDDefsDone() {
- updateStatusMessage("-Total of "+(OIDIndex/OIDRecLength)+" OID Definition Record(s) Processed<br>");
- updateStatusMessage("-Total of "+OIDCount+" OID Definition Record(s) Added<br>");
- updateStatusMessage("<br>{Importing SNMP Trap WATCH Records}<br>");
- if ( RpmCC_AC.EnumSnmpTrapMonitor() ) { // if unable to initiate request
- updateStatusMessage("Unable to start the SNMP Trap Monitor LOOKUP request<br>");
- processResetButton(); // reset
- }
- }
- function processEnumSnmpTrapMonitor(TMstrg) {
- // get and save current SNMP Trap Monitorir Records to filter out duplicates
- var warr = new Array();
- // If done reading all records
- if ( TMstrg == "Done" ) {
- Tid = setTimeout("processSNMPTrapRecordAdd()",10); // get SNMP Trap records
- }
- else {
- // Check if error
- warr = TMstrg.split(":");
- if ( warr[0] == "Err" ) {
- updateStatusMessage("An Error occurred reading SNMP Trap WATCH records<br>");
- Tid = setTimeout("processSNMPTrapRecordDone()",10); // skip SNMP Trap records
- }
- // Otherwise, process record
- else {
- var si = TMstrg.indexOf("~"); // strip off the Trap Monitor ID.
- TMstrg = TMstrg.substring(si+1,TMstrg.length)
- SNMPTMarr[SNMPTrapLupRecCount] = TMstrg; // save TrapMonitor Record
- ++SNMPTrapLupRecCount;
- }
- }
- }
- function processSNMPTrapRecordAdd() {
- Tid = null;
- var warr = new Array;
- if ( SNMPTrapIndex < AC_TrapMonitorStore.length ) {
- var TMstrg = AC_TrapMonitorStore[SNMPTrapIndex].text;
- var si = TMstrg.indexOf("~"); // strip off the Trap Monitor ID.
- TMstrg = TMstrg.substring(si+1,TMstrg.length)
- warr = TMstrg.split("~");
- SNMPTrapName = warr[2]; // Alert Group Name
- ComputerName = warr[1];
- warr[1] = getComputerID(warr[1]); // get Comp ID from name
- warr[2] = getAlertGroupID(warr[2]); // get AGID from name
- TMstrg = warr.join("~")
- AC_TrapMonitorStore[SNMPTrapIndex].text = TMstrg;
- // Check if duplicate
- for ( var i=0; i<SNMPTMarr.length; i++ ) {
- if ( SNMPTMarr[i] == TMstrg ) { // if already exists, ignore
- ++SNMPTrapIndex;
- updateStatusMessage("-Duplicate Record: '"+SNMPTrapName+"' for '"+ComputerName+"'<br>");
- Tid = setTimeout("processSNMPTrapRecordAdd()",10); // get SNMP Trap records
- return;
- }
- }
- // otherwise, add
- rstat = RpmCC_AC.SnmpTrapMonitorAdd(TMstrg);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- ++SNMPTrapIndex;
- return;
- }
- }
- processSNMPTrapRecordDone();
- }
- function processSNMPTrapRecordDone() {
- updateStatusMessage("-Total of "+SNMPTrapIndex+" SNMP Trap WATCH Record(s) Processed<br>");
- updateStatusMessage("-Total of "+SNMPTrapCount+" SNMP Trap WATCH Record(s) Added<br>");
- updateStatusMessage("<br>{Importing USER Records}<br>");
- Tid = setTimeout("processUserRecordAdd()",10); // get User records
- }
- function processUserRecordAdd() {
- Tid = null;
- if ( UserIndex < AC_UserStore.length ) {
- // Start Write of User Records
- UserName = AC_UserStore[UserIndex+0].text;
- rstat = RpmCC_AC.UserAdd(UserName,AC_UserStore[UserIndex+2].text,
- AC_UserStore[UserIndex+3].text,
- ((AC_UserStore[UserIndex+4].text == "checked")?"1":"0"),
- ((AC_UserStore[UserIndex+5].text == "checked")?"1":"0") );
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- UserIndex += UserRecLength;
- return;
- }
- }
- updateStatusMessage("-Total of "+(UserIndex/UserRecLength)+" USER Record(s) Processed<br>");
- updateStatusMessage("-Total of "+UserCount+" USER Record(s) Added<br>");
- updateStatusMessage("<br>{Importing REPORT Records}<br>");
- Tid = setTimeout("processReportRecordAdd()",10); // go next with Report record
- }
- function processReportRecordAdd() {
- Tid = null;
- var warr = new Array;
- if ( ReportIndex < AR_RptStore.length ) {
- // Start Write of Report Records
- ReportName = AR_RptStore[ReportIndex+0].text;
- RptDesc = AR_RptStore[ReportIndex+2].text;
- RptAIA = AR_RptStore[ReportIndex+4].text;
- RptCIA = getComputerIDArray(AR_RptStore[ReportIndex+5].text);
- rstat = RpmCC_AC.AdminReportsAdd(ReportName,RptDesc,RptAIA,RptCIA);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- ReportIndex += ReportRecLength;
- return;
- }
- }
- processReportRecordDone();
- }
- function processReportRecordDone() {
- updateStatusMessage("-Total of "+(ReportIndex/ReportRecLength)+" REPORT Record(s) Processed<br>");
- updateStatusMessage("-Total of "+ReportCount+" REPORT Record(s) Added<br>");
- Tid = setTimeout("processAlertGroupFinal()",10); // Done
- }
- function processAlertGroupFinal() {
- AGFinal = true;
- ServiceOp = "Enable";
- var warr = new Array;
- var SrvcCompArr = new Array;
- // Complete processing of each Alert group
- for (var i=AGFinalIdx; i < AGNArray.length; i+=3) {
- // If Service Type, Enable Services if necessary
- if ( AGNArray[i+2] == ServicesType ) {
- for ( var j=0,k=0; j<AC_ServicesStore.length; ++j ) {
- warr = AC_ServicesStore[j].text.split("~"); // parse
- if ( (warr[1] == AGNArray[i+1]) && (warr[10] == "0") ) { // if match on AGID & Enabled
- SrvcCompArr[k++] = warr[0]; // save Computer ID
- ServiceType = (warr[2] == "SQL") ? "SQLCONNECT" : warr[2];
- ServiceFreq = warr[6]+","+warr[7]+","+warr[8]+","+warr[9];
- ServiceAGID = warr[1];
- }
- }
- ServiceCID = (SrvcCompArr.sort()).join(",");
- rstat = RpmCC_AC.ServicesAlertEnabled(ServiceType,ServiceFreq,ServiceAGID,ServiceCID);
- if ( !rstat ) { // if OK on initiate request
- ignoreDBChangeEvent = true;
- AGFinalIdx+=3;
- return;
- }
- }
- // Check other Alert Types
- }
- // Done checking all Alert Groups
- Tid = setTimeout("processGlobalSettings()",10); // Done
- }
- function processGlobalSettings() {
- updateStatusMessage("<br>{Importing GLOBAL Settings}<br>");
-
- if ( RpmCC_AC.SecuritySet(((AC_UserStore.SecuritySetting == true) ? "1" : "0")) ) {
- updateStatusMessage("-Unable to save Global Enable Security settingd<br>");
- }
- if ( RpmCC_AC.SetAutoAgentRegister(((AC_UserStore.AutoAgentSetting == true) ? "1" : "0")) ) {
- updateStatusMessage("-Unable to save Auto Agent Registration setting<br>");
- }
-
- RpmCC_AC.SetGlobalSMTP(AC_AlertStore.SMTPSetting); // save Global setting
- RpmCC_AC.SetGlobalBeeper(AC_AlertStore.BeeperSetting); // save Global setting
-
- updateStatusMessage("<br>");
- Tid = setTimeout("processImportDone()",10); // Done
- }
- function processImportDone() {
- updateStatusMessage("Done Importing Saved 'Admin' Data<br>");
- RpmCC_AC.RegSetKey("AdminDataSaved","0"); // save flag
- processResetButton(); // reset
- }
-
-
- /* Get Group ID from Store based on Group Name */
- function getGroupID(GNM) {
- var GID = 0;
- for (var i=0; i < AC_GrpStore.length; i+=GroupRecLength) {
- if ( AC_GrpStore.options[i].text == GNM ) {
- GID = AC_GrpStore.options[i+1].text;
- break;
- }
- }
- return GID;
- }
- function getServerID(SvNm) {
- var SvID = 0;
- for (var i=0; i < AC_SrvStore.length; i+=ServerRecLength) {
- if ( AC_SrvStore.options[i].text == SvNm ) {
- SvID = AC_SrvStore.options[i+1].text;
- break;
- }
- }
- return SvID;
- }
- function getComputerID(Cnme) {
- var CID = "";
- for (var i=0; i < CArray.length; i+=2) {
- if ( CArray[i] == Cnme ) {
- CID = CArray[i+1];
- break;
- }
- }
- return CID;
- }
- function getComputerIDArray(CNA) {
- var warr = new Array();
- warr = CNA.split(","); //parse out the Computer Names
- for ( var i=0; i<warr.length; i++ ) {
- warr[i] = getComputerID(warr[i]);
- }
- var CIA = warr.join(",");
- return CIA;
- }
- function getAlertGroupID(AGN) {
- var AGID = "";
- for (var i=0; i < AGNArray.length; i+=3) {
- if ( AGNArray[i] == AGN ) {
- AGID = AGNArray[i+1];
- break;
- }
- }
- return AGID;
- }
-
- function processResetButton() {
- SetCursor("auto");
- top.banner.processStopCommX();
- StatusPrintButton.disabled = ""; // enable button
- if ( top.banner.IE55orBetter ) {
- StatusMessage.scrollIntoView(false);
- }
- }
-
- function SetCursor(ctyp) {
- document.body.style.cursor=ctyp;
- }
- function updateStatusMessage(sMsg) {
- if ( top.banner.IE55orBetter ) {
- StatusMessage.insertAdjacentHTML("beforeEnd",sMsg);
- StatusMessage.scrollIntoView(false);
- }
- else {
- StatusMessageDiv.insertAdjacentHTML("beforeEnd",sMsg);
- }
- }
- function SetButtonState(BtObj,BState) {
- BtObj.disabled = (BState == "0") ? "" : "disabled";
- BtObj.bdis = BState;
- }
- /* Add an <Option> entry with the text to the specified <Select> */
- function addElementToSelect(SelectObj,text) {
- var el = document.createElement("OPTION");
- el.text = text;
- SelectObj.options.add(el);
- return el;
- }
-
- function processCounterAlert(COC) {
- var OCarr = new Array();
- var warr = new Array();
- OCarr = COC.split(";"); // get C,O,Cnt triplets
- for ( var j=0; j<OCarr.length; j++ ) {
- warr = OCarr[j].split(","); // split out Cid
- warr[0] = getComputerID(warr[0]); // convert Name to CID
- OCarr[j] = warr.join(","); // reform
- }
- var nCOC = OCarr.join(";"); // put triplets back
- return nCOC;
- }
- function getCurrentAT(CSdt) {
- // Determine Alert Type
- if ( CSdt == "01/01/1999 11:30:00" || CSdt == "1/1/1999 11:30:0" ) {
- CurAT = ServicesType;
- }
- else if ( CSdt == "01/01/1999 11:50:00" || CSdt == "1/1/1999 11:50:0" ) {
- CurAT = UserType;
- }
- else if ( CSdt == "01/01/1999 11:40:00" || CSdt == "1/1/1999 11:40:0" ) {
- CurAT = EventLogType;
- }
- else {
- CurAT = CounterType;
- }
- return CurAT;
- }
-
- function PopUpContextOpen() {
- }
- function PopUpContextClose() {
- }
-
- // Print Status
- var DiscStatWindow = null;
- function processPrintStatus() {
- if ( !top.banner.IE55orBetter ) {
- alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site");
- return;
- }
- FakeBut.click(); // simulate event to call "savePageCoord(...)"
- var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw
- wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars";
- var rName = ""+Math.random(); // use Random number to get unique Window name
- rName = rName.substring(2,rName.length);
- DiscStatWindow = window.open("",rName,wprop);
- if ( DiscStatWindow == null ) {
- return;
- }
- var dh = "<html><head><title>MonitorIT - 'Admin' Data IMPORT Status Report</title>";
- dh += "<link rel='stylesheet' type='text/css' href='css/Rpmstyle.css'>";
- dh += "<style>#StatusMessage {height:280; width:400; font-family:arial; ";
- dh += "font-size: 10pt; font-weight: 700; color: windowtext;}</style></head><body";
- dh += " title='Exit to Close Window when Printing is complete'>";
- dh += StatusMessageDiv.innerHTML;
- dh += '<script LANGUAGE="JavaScript">window.focus();';
- dh += ' </script></body></html>';
- DiscStatWindow.document.open();
- DiscStatWindow.document.write(dh)
- DiscStatWindow.document.close();
- DiscStatWindow.print();
- }
-
-
- //-->
- </script>
- <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script>
-
- </head>
-
- <body class="bodyc" style="margin:2px;" RPMHostIP="!BreakoutBot:MonitorIP!"
- RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" RPMCollectorPort="!BreakoutBot:CollectorPort!" RPMAgentPort="!BreakoutBot:AgentListenPort!"
- onload="top.banner.savePageCoord(event,document.body,'AdminDataBase');processOnLoad();" onbeforeunload="processUnload()" onclick="checkClick()" onkeydown="processBSP()">
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ServerRootDir(srvrdir)">
- <!--
- Srd = srvrdir;
- Tid = setTimeout("processDBUpdateContinue()",100); // Delay then process
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="Connected()">
- <!--
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="UserAddErrorDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+UserName+"'<br>");
- Tid = setTimeout("processUserRecordAdd()",10); // get next User record
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="UserErrorAddDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+UserName+"'<br>");
- Tid = setTimeout("processUserRecordAdd()",10); // get next User record
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="UserOpComplete()">
- <!--
- ++UserCount;
- Tid = setTimeout("processUserRecordAdd()",10); // get next User record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="UserOpError()">
- <!--
- updateStatusMessage("-Update Error: '"+UserName+"'<br>");
- Tid = setTimeout("processUserRecordAdd()",10); // get next User record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ServersAddErrorDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+ServerName+"'<br>");
- Tid = setTimeout("processServerRecordAdd()",10); // get next Server record
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ServersOpComplete()">
- <!--
- ++ServerCount;
- Tid = setTimeout("processServerRecordAdd()",10); // get next Server record
- //-->
- </script> <script
- LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ServersOpError()">
- <!--
- updateStatusMessage("-Update Error: '"+ServerName+"'<br>");
- Tid = setTimeout("processServerRecordAdd()",10); // get next Server record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="GroupAddErrorDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+GroupName+"'<br>");
- Tid = setTimeout("processGroupRecordAdd()",10); // get next Group record
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="GroupOpComplete()">
- <!--
- if ( GroupLookupFlag ) {
- processGroupOpComplete();
- }
- else {
- ++GroupCount;
- Tid = setTimeout("processGroupRecordAdd()",10); // get next Group record
- }
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="GroupOpError()">
- <!--
- if ( GroupLookupFlag ) {
- processGroupOpError()
- }
- else {
- updateStatusMessage("-Update Error: '"+GroupName+"'<br>");
- Tid = setTimeout("processGroupRecordAdd()",10); // get next Group record
- }
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="GroupLookupRecord(Gid,GNme,GDesc)">
- <!--
- processGroupLookupRecord(Gid,GNme,GDesc);
- //-->
- </script>
-
- <script FOR="RpmCC_AC" EVENT="ComputerAddOpComplete(cid)">
- <!--
- // Save computer name and ID
- CArray[ComputerCount++] = ComputerName;
- CArray[ComputerCount++] = cid;
- Tid = setTimeout("processComputerRecordAdd()",10); // get next Computer record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerAddErrorLicense()">
- <!--
- updateStatusMessage("-At License Max, Record: '"+ComputerName+"' Not Added<br>");
- Tid = setTimeout("processComputerRecordAdd()",10); // get next Computer record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerOpError()">
- <!--
- if ( ComputerLookupFlag ) {
- updateStatusMessage("-Server/Computer Lookup Read Error<br>");
- processResetButton();
- }
- else {
- updateStatusMessage("-Update Error: '"+ComputerName+"'<br>");
- Tid = setTimeout("processComputerRecordAdd()",10); // get next Computer record
- }
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerAddErrorDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+ComputerName+"'<br>");
- Tid = setTimeout("processComputerRecordAdd()",10); // get next Computer record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerAddErrorBadGroup()">
- <!--
- updateStatusMessage("-Invalid Group, Record: '"+ComputerName+"' Not Added<br>");
- Tid = setTimeout("processComputerRecordAdd()",10); // get next Computer record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerLookupRecord(Cid,Gid,SrvID,Nme,Desc,Pswd,OSVer,Addr,Port)">
- <!--
- // Save computer name and ID
- CArray[ComputerCount++] = Nme;
- CArray[ComputerCount++] = Cid;
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ComputerOpComplete()">
- <!--
- if ( ComputerLookupFlag ) {
- processComputerLookupDone();
- }
- //-->
- </script>
-
- <script FOR="RpmCC_AC" EVENT="ServicesRecord(SRVstrg)">
- <!--
- processServicesRecord(SRVstrg);
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ServicesOpComplete()">
- <!--
- // No processing required. It is handled by the ServicesAddOpComplete
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ServicesAddOpComplete(sid)">
- <!--
- ++ServiceCount;
- Tid = setTimeout("processServicesRecordAdd()",10); // get next Services record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AlertServicesOpComplete()">
- <!--
- if ( AGFinal ) {
- Tid = setTimeout("processAlertGroupFinal()",10); // process next Alert Group
- }
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AlertServicesOpError()">
- <!--
- if ( AGFinal ) {
- Tid = setTimeout("processAlertGroupFinal()",10); // process next Alert Group
- }
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="ServicesOpError()">
- <!--
- if ( ServiceOp ) {
- updateStatusMessage("-Update Error: '"+ServiceName+"' Service for '"+ComputerName+"'<br>");
- Tid = setTimeout("processServicesRecordAdd()",10); // get next Services record
- }
- //-->
- </script>
-
- <script FOR="RpmCC_AC" EVENT="AdminReportsOpComplete()">
- <!--
- ++ReportCount;
- Tid = setTimeout("processReportRecordAdd()",10); // get next Report record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AdminReportsErrorAddDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+ReportName+"'<br>");
- Tid = setTimeout("processReportRecordAdd()",10); // get next Report record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AdminReportsOpError()">
- <!--
- updateStatusMessage("-Update Error: '"+ReportName+"'<br>");
- Tid = setTimeout("processReportRecordAdd()",10); // get next Report record
- //-->
- </script>
-
- <script FOR="RpmCC_AC" EVENT="AlertGroupAddOpComplete(NAGID)">
- <!--
- // Save Alert Group name and ID
- AGNArray[WatchCount++] = WatchName;
- AGNArray[WatchCount++] = NAGID;
- AGNArray[WatchCount++] = CurrentAT;
- Tid = setTimeout("processWatchRecordAdd()",10); // get next Watch record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AlertGroupOpError()">
- <!--
- if ( WatchLookup ) {
- updateStatusMessage("-Watch/Alert Lookup Read Error<br>");
- processResetButton();
- }
- else {
- updateStatusMessage("-Update Error: '"+WatchName+"'<br>");
- Tid = setTimeout("processWatchRecordAdd()",10); // get next Watch record
- }
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AlertGroupOpErrorDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+WatchName+"'<br>");
- Tid = setTimeout("processWatchRecordAdd()",10); // get next Watch record
- //-->
- </script>
- <script FOR="RpmCC_AC" EVENT="AlertGroupErrorAddDuplicate()">
- <!--
- updateStatusMessage("-Duplicate Record: '"+WatchName+"'<br>");
- Tid = setTimeout("processWatchRecordAdd()",10); // get next Watch record
- //-->
- </script>
- <script FOR="RpmCC_AC"
- EVENT="AlertGroupLookupRecordPart1(AlID, AlName, AlDesc, AlThresh, AlOver, AlEveryTime, AlDur, AlSched, AlSDT, AlEDT, AlArrayIDs)">
- <!--
- // Save Alert Group name and ID
- AGNArray[WatchCount++] = AlName;
- AGNArray[WatchCount++] = AlID;
- AGNArray[WatchCount++] = getCurrentAT(AlSDT);
- //-->
- </script>
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="AlertGroupOpComplete()">
- <!--
- if ( WatchLookup ) {
- processAlertGroupLookupDone();
- }
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="EnumSnmpTrapMonitor(TMstrg)">
- <!--
- processEnumSnmpTrapMonitor(TMstrg);
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="SnmpTrapMonitorAdd(Rstrg)">
- <!--
- if ( Rstrg == "OK" ) {
- ++SNMPTrapCount;
- }
- else {
- updateStatusMessage("-Update Error: '"+SNMPTrapName+"' SNMP Trap WATCH for '"+ComputerName+"'<br>");
- }
- Tid = setTimeout("processSNMPTrapRecordAdd()",10); // get next SNMP Trap record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="OidDefs(Rstrg)">
- <!--
- var warr = new Array();
- warr = Rstrg.split("~")
- if ( warr[1] == "0" ) { //if successful
- ++OIDCount
- }
- else {
- if ( warr[1].indexOf("duplicate") > 0 ) {
- updateStatusMessage("-Duplicate Record: OID Definition for '"+OIDName+"'<br>");
- }
- else {
- updateStatusMessage("-Update Error: OID Definition for '"+OIDName+"'<br>");
- }
- }
- Tid = setTimeout("processOIDDefsRecordAdd()",10); // get next OID Def record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ELMonitorOpComplete()">
- <!--
- ++ELCount;
- Tid = setTimeout("processELRecordAdd()",10); // get next EL record
- //-->
- </script>
-
- <script LANGUAGE="JavaScript" FOR="RpmCC_AC" EVENT="ELMonitorOpError()">
- <!--
- updateStatusMessage("-Update Error: '"+ELName+"' EVENT LOG WATCH for '"+ComputerName+"'<br>");
- Tid = setTimeout("processELRecordAdd()",10); // get next EL record
- //-->
- </script>
-
- <script FOR="RpmCC_AC" EVENT="OpErrorDup()">
- <!--
- if ( ServiceOp ) {
- updateStatusMessage("-Duplicate Record: '"+ServiceName+"' for '"+ComputerName+"'<br>");
- Tid = setTimeout("processServicesRecordAdd()",10); // get next Services record
- }
- else if ( ELOp ) {
- updateStatusMessage("-Duplicate Record: '"+ELName+"' for '"+ComputerName+"'<br>");
- Tid = setTimeout("processELRecordAdd()",10); // get next EL record
- }
- //-->
- </script>
-
-
- <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script>
-
- <!-- Invisible Object to Support Simulated Click Event -->
- <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'AdminDataImport')">
- </button>
-
- <object ID="RpmCC_AC" NAME="RpmCC_AC" WIDTH="14" HEIGHT="1" style="display: none"
- CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80"
- CODEBASE="controls/RPMComm.cab#version=5,2,0,0">
- <param name="_Version" value="65536">
- <param name="_ExtentX" value="2646">
- <param name="_ExtentY" value="1371">
- <param name="_StockProps" value="0">
- </object>
-
- <!--<br>-->
- <div id="TopL" align="center"><center>
-
- <div><center>
-
- <table class="fldset" border="2" width="475" cellspacing="2" cellpadding="2" height="150">
- <tr>
- <td>
- <table border="1" borderColor="menu" align="left">
- <tr><td borderColorDark="graytext" borderColorLight="white" height="25" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/DataSave.gif" align="absmiddle" height="17" width="16"> 'Admin' Data Import </td><td width="*"></td>
- </tr></table>
- </td>
- </tr>
- <tr>
- <td>
- <table border="0">
- <tr><td width="70" align="center" height="300"><img src="images/DataSave.gif" align="absmiddle" height="25" width="24"></td><td><div class="StatMsg" id="StatusMessageDiv"><span id="StatusMessage">Press Start Button to Begin Import of Saved 'Admin' Data<br></span></div><div id="AdminDataStore" style="display:none">
- <select SIZE="1" NAME="AC_Store" style="display: none"></select>
- <select SIZE="1" NAME="AC_GrpStore" style="display: none"></select>
- <select SIZE="1" NAME="AC_SrvStore" style="display: none"></select>
- <select SIZE="1" NAME="AC_ServicesStore" style="display: none"></select>
- <select SIZE="1" NAME="AC_UserStore" AutoAgentSetting="1" SecuritySetting="0" style="display: none"></select>
- <select SIZE="1" NAME="AC_AlertStore" SMTPSetting="" BeeperSetting="" style="display: none"></select>
- <select SIZE="1" NAME="AR_RptStore" style="display: none"></select>
- <select SIZE="1" NAME="AC_ELStore" style="display: none"></select>
- <select SIZE="1" NAME="AC_TrapMonitorStore" OIDDefs="" style="display: none"></select>
- </div></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td align="center" height="30">
- <button id="CStartButton" title="Start the Process to Save Database 'Admin' Data" onclick="if (this.bdis == '0'){ processStartButton();}" bdis="0" style="width:80px; height:28px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img src="images/apply.gif" align="absmiddle" height="16" width="16"> Start</button> <button id="StatusPrintButton" title="Print 'Admin' Data Export Status Log" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:85px; height:29px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" DISABLED><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button></td></tr>
-
- </table>
-
- </center></div>
-
- </center></div>
- </body>
- </html>
-